package com.iti.jets.gpts.home;

// default package
// Generated Mar 22, 2014 9:41:00 PM by Hibernate Tools 3.4.0.CR1

import com.iti.jets.gpts.dao.AbstractDAO;
import com.iti.jets.gpts.pojo.Comments;
import com.iti.jets.gpts.pojo.Feedback;
import java.util.List;
import org.hibernate.Criteria;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Restrictions;

/**
 * Home object for domain model class Comments.
 * @see .Comments
 * @author Hibernate Tools
 */
public class CommentsHome extends AbstractDAO<Comments> {

    public CommentsHome(SessionFactory sessionFactory) {
        super(sessionFactory);
    }
     public List getAllComments(int id) {
       
        Criteria criteria = session.createCriteria(Comments.class, "c")
                .add(Restrictions.eq("c.tranService.id", id));
        List<Comments> result = criteria.list();
           return result;
            
    }
     public int getAllComments() {
       
        Criteria criteria = session.createCriteria(Comments.class, "c");
                
        List<Comments> result = criteria.list();
           return result.size();
            
    }
     
}
